# coding=utf-8

pk = '12345600000000.0325'

def format(pk, index=3):
    d = {1:2, 2:4, 3:6, 4:9, 5:12}
    try:
        pk = int(float(pk))
    except:
        raise ValueError, 'the primary key must be integer or string interger'
    return int(str(pk)[:d[index]])
    while (pk * 1.0 / 10).is_integer():
        pk = pk * 1.0 / 10
    return pk < 10 and int(pk) * 10 or int(pk)

print format(pk)

